import { defineStore } from 'pinia'

export const useStore = defineStore('main', {
  state: () => {
    return {
      token: null
    }
  },
  actions: {
    setToken(data) {
      this.token = data.token;
	  let usermsg = JSON.stringify(data);
	  localStorage.setItem('usermsg',usermsg)
      localStorage.setItem('is_key',data.is_key)
      localStorage.setItem('token', data.token)
      localStorage.setItem('effective_time', data.effective_time)
      localStorage.setItem('ip', data.ip)
      localStorage.setItem('login_time', data.login_time)
    }
  }
})
